﻿<UserControl x:Class="HSS.Interlink.UI.UploadFileDetail" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:h="clr-namespace:HSS.Interlink.UI" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

	<Grid x:Name="LayoutRoot" Background="White" Width="400">
		<Grid.Resources>
			<h:ByteConverter x:Key="ByteConverter" />
			<h:PercentageConverter x:Key="PercentageConverter" />
			<h:TransferRateConverter x:Key="TransferRateConverter" />
			<h:TimeConverter x:Key="TimeConverter" />
		</Grid.Resources>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="10" />
			<ColumnDefinition Width="70" />
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="5" />
		</Grid.ColumnDefinitions>

		<Grid.RowDefinitions>
			<RowDefinition Height="5" />
			<RowDefinition Height="23" />
			<RowDefinition Height="23" />
			<RowDefinition Height="23" />
			<RowDefinition Height="23" />
			<RowDefinition Height="23" />
			<RowDefinition Height="28" />
			<RowDefinition Height="75" />
			<RowDefinition Height="5" />
		</Grid.RowDefinitions>

		<TextBlock Grid.Column="1" Grid.Row="1" Margin="5" FontWeight="Bold" HorizontalAlignment="Left" Text="File:" VerticalAlignment="Center" />
		<TextBlock Grid.Column="2" Grid.Row="1" Margin="5" Text="{Binding FileName}" VerticalAlignment="Center" />

		<TextBlock Grid.Column="1" Grid.Row="2" Margin="5" FontWeight="Bold" HorizontalAlignment="Left" Text="State:" VerticalAlignment="Center" />
		<TextBlock Grid.Column="2" Grid.Row="2" Margin="5" Text="{Binding State}" VerticalAlignment="Center" />

		<TextBlock Grid.Column="1" Grid.Row="3" Margin="5" FontWeight="Bold" HorizontalAlignment="Left" Text="Bytes:" VerticalAlignment="Center" />
		<StackPanel Grid.Column="2" Grid.Row="3" Margin="5" Orientation="Horizontal">
			<TextBlock Text="{Binding BytesUploaded, Converter={StaticResource ByteConverter}}" VerticalAlignment="Center" />
			<TextBlock Text=" of " VerticalAlignment="Center" />
			<TextBlock Text="{Binding FileLength, Converter={StaticResource ByteConverter}}" VerticalAlignment="Center" />
		</StackPanel>

		<TextBlock Grid.Column="1" Grid.Row="4" Margin="5" FontWeight="Bold" HorizontalAlignment="Left" Text="Elapsed:" VerticalAlignment="Center" />
		<TextBlock Grid.Column="2" Grid.Row="4" Margin="5" Text="{Binding ElapsedTime, Converter={StaticResource TimeConverter}}" VerticalAlignment="Center" />

		<TextBlock Grid.Column="1" Grid.Row="5" Margin="5" FontWeight="Bold" HorizontalAlignment="Left" Text="Rate:" VerticalAlignment="Center" />
		<TextBlock Grid.Column="2" Grid.Row="5" Margin="5" Text="{Binding TransferRate, Converter={StaticResource TransferRateConverter}}" VerticalAlignment="Center" />

		<TextBlock Grid.Column="1" Grid.Row="6" Margin="5" FontWeight="Bold" HorizontalAlignment="Left" Text="Progress:" VerticalAlignment="Center" />
		<Grid Grid.Column="2" Grid.Row="6" Margin="5">
			<ProgressBar HorizontalAlignment="Stretch" Value="{Binding Percentage}" />
			<TextBlock Text="{Binding Percentage, Converter={StaticResource PercentageConverter}}" TextAlignment="Center" />
		</Grid>

		<TextBlock Grid.Column="1" Grid.Row="7" Margin="5" FontWeight="Bold" HorizontalAlignment="Left" Text="Errors:" VerticalAlignment="Top" />
		<TextBox x:Name="txtLastException" Grid.Column="2" Grid.Row="7" Margin="5" Foreground="Brown" HorizontalScrollBarVisibility="Disabled" IsReadOnly="True" Text="{Binding Error}" TextWrapping="Wrap" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Visible" />

	</Grid>
</UserControl>